<template>
  <div class="container">
    <!-- 内容区域 -->
    <div class="screen" ref="screen">
      <div class="top"><Top /></div>
      <div class="bottom">
        <div class="bottom_left">
          <div class="left_top">
            <LeftTop />
          </div>
          <div class="left_middle">
            <LeftMiddle />
          </div>
          <div class="left_bottom">
            <LeftBottom />
          </div>
        </div>
        <div class="bottom_center">
          <div class="center_top"><CenterTop /></div>
          <div class="center_bottom"><CenterBottom /></div>
        </div>
        <div class="bottom_right">
          <div class="right_top"><RightTop /></div>
          <div class="right_middle"><RightMiddle /></div>
          <div class="right_bottom"><RightBottom /></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup name="index">
import RightTop from './components/bottomRight/RightTop.vue'
import RightMiddle from './components/bottomRight/RightMiddle.vue'
import RightBottom from './components/bottomRight/RightBottom.vue'
import CenterBottom from './components/bottomCenter/CenterBottom.vue'
import CenterTop from './components/bottomCenter/CenterTop.vue'
import Top from './components/top/index.vue'
import LeftTop from './components/bottomLeft/LeftTop.vue'
import LeftMiddle from './components/bottomLeft/LeftMiddle.vue'
import LeftBottom from './components/bottomLeft/LeftBottom.vue'
import { onMounted, ref } from 'vue'
let screen = ref()
onMounted(() => {
  getScale()
})
const getScale = () => {
  const ww = window.innerWidth / 1920
  const hh = window.innerHeight / 1080
  const result = ww > hh ? hh : ww

  screen.value.style.transform = `scale(${result}) translate(-50%,-50%)`
}
window.onresize = () => {
  getScale()
}
</script>
<style scoped lang="scss">
.container {
  height: 100vh;
  width: 100vw;
  background: url('./images/bg.png') no-repeat;
  background-size: cover;
  .screen {
    position: fixed;
    width: 1920px;
    height: 1080px;
    transform-origin: left top;
    left: 50%;
    top: 50%;
    .top {
      width: 100%;
      height: 50px;
    }
    .bottom {
      display: flex;
      height: 1030px;
      padding: 10px 20px;
      .bottom_left {
        flex: 1.5;
        display: flex;
        flex-direction: column;
        .left_top {
          flex: 3;
          background: url('./images/dataScreen-main-lt.png') no-repeat;
          background-size: cover;
        }
        .left_middle {
          flex: 2.5;
          background: url('./images/dataScreen-main-lc.png') no-repeat;
          background-size: cover;
          margin: 25px 0px;
        }
        .left_bottom {
          flex: 2;
          background: url('./images/dataScreen-main-lb.png') no-repeat;
          background-size: cover;
        }
      }
      .bottom_right {
        flex: 1.5;
        display: flex;
        flex-direction: column;
        .right_top {
          flex: 3;
          background: url('./images/dataScreen-main-lt.png') no-repeat;
          background-size: cover;
        }
        .right_middle {
          flex: 2.5;
          background: url('./images/dataScreen-main-lc.png') no-repeat;
          background-size: cover;
          margin: 25px 0px;
        }
        .right_bottom {
          flex: 2;
          background: url('./images/dataScreen-main-lb.png') no-repeat;
          background-size: cover;
        }
      }
      .bottom_center {
        flex: 3;
        display: flex;
        flex-direction: column;
        padding: 20px 20px 0 20px;
        .center_top {
          flex: 4;
          background: url('./images/') no-repeat;
          background-size: cover;
        }
        .center_bottom {
          flex: 1.5;
          background: url('./images/dataScreen-main-cb.png') no-repeat;
          background-size: cover;
        }
      }
    }
  }
}
</style>
